﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utils
{
    /// <summary>
    /// 日期时间工具类
    /// </summary>
    public class DateTimeUtil
    {
        /// <summary>
        /// 获取2012-12-12 22:22：22格式的日期时间字符串
        /// </summary>
        /// <returns>日期时间</returns>
        public static string GetDateTime()
        {
            return System.DateTime.Now.ToString().Replace('/', '-');
        }

        /// <summary>
        /// 精确到Day
        /// </summary>
        /// <returns></returns>
        public static string GetDayDateTime()
        {
            return System.DateTime.Now.ToShortDateString().ToString().Replace('/', '-');
        }
    }
}
